export default defineNuxtConfig({
	extends: ['@nuxt/ui-pro'],

	modules: [
		'@nuxt/content',
		// '@nuxt/fonts',
		'@nuxt/image',
		'@nuxt/ui',
		'@nuxthq/studio',
		'@vueuse/nuxt',
		'nuxt-og-image',
		'@ant-design-vue/nuxt',
		'@pinia/nuxt',
		'pinia-plugin-persistedstate/nuxt',
	],

	devtools: {
		enabled: true,
	},

	colorMode: {
		disableTransition: true,
	},

	routeRules: {
		'/api/search.json': { prerender: true },
		'/docs': { redirect: '/docs/getting-started', prerender: false },
	},

	future: {
		compatibilityVersion: 4,
	},

	compatibilityDate: '2024-07-11',

	nitro: {
		prerender: {
			routes: ['/', '/docs'],
			crawlLinks: true,
		},
	},

	typescript: {
		strict: false,
	},

	hooks: {
		// Define `@nuxt/ui` components as global to use them in `.md` (feel free to add those you need)
		'components:extend': (components) => {
			const globals = components.filter((c) => ['UButton'].includes(c.pascalName));

			globals.forEach((c) => (c.global = true));
		},
	},

	vite: {
		resolve: {
			alias: {
				'ant-design-vue/dist': 'ant-design-vue/dist',
				'ant-design-vue/es': 'ant-design-vue/es',
				'ant-design-vue/lib': 'ant-design-vue/es',
				'ant-design-vue': 'ant-design-vue/es',
			},
		},
	},
});
